﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeviceManage.aspx.cs" Inherits="iEN.Organization.DeviceManage" MaintainScrollPositionOnPostback="true" EnableEventValidation="false"%>
<%@ Register src="../UserControl/TopMenu.ascx" tagname="TopMenu" tagprefix="uc2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <center>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </div>
    <table  style="width: 952px">  
        <tr>
            <td><uc2:TopMenu ID="TopMenu1" runat="server" /></td>                
        </tr>
        <tr>
            <td style="background-image:url('../images/title_back.gif')" align="center" ; width="952px" >
                <asp:Label ID="Label2" runat="server" Text="設 備 管 理" BackColor="Transparent" Font-Names="標楷體" Font-Size="XX-Large" ForeColor="Blue"></asp:Label>
            </td>              
        </tr>
        <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate >
                    <asp:Label ID="lblMsg" runat="server" Font-Names="微軟正黑體" Font-Size="X-Large" 
                        ForeColor="Red" Text="你沒有瀏覽此頁面的權限" Visible="False"></asp:Label>
                    <tr>
                        <td>
                        <asp:Panel ID="Panel2" runat="server" GroupingText="請選控制器" BackColor="Transparent" 
                                Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" 
                                style="width: 952px" HorizontalAlign="Left">
                            <asp:Label ID="Label1" runat="server" ForeColor="Black" Text="控制器：" 
                                Font-Size="Medium"></asp:Label>
                            <asp:DropDownList ID="ddlControl" runat="server" CssClass="normal" AutoPostBack="True" 
                                Font-Size="Medium" onselectedindexchanged="ddlControl_SelectedIndexChanged">
                            </asp:DropDownList>
                        </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Panel ID="Panel1" runat="server" GroupingText="設備列表" 
                                BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" 
                                Font-Size="16px" ForeColor="Black" style="width: 952px" 
                                HorizontalAlign="Center" Visible="False">
                                
                                <asp:GridView ID="gvGrpName" runat="server" CellPadding="4" EmptyDataText="尚未設定相關資料！" 
                                    ForeColor="#333333" AutoGenerateColumns="False" 
                                    style="width: 500px; margin-top: 0px;" 
                                    ondatabound="gvGrpName_DataBound" HorizontalAlign="Center" onrowdeleting="gvGrpName_RowDeleting" 
                                    onselectedindexchanging="gvGrpName_SelectedIndexChanging" 
                                    onrowdatabound="gvGrpName_RowDataBound" >
                                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" Font-Size="Medium" />
                                <RowStyle BackColor="#E3EAEB" Font-Size="Medium"/>
                                <EmptyDataRowStyle CssClass="note" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" Font-Size="Medium" />
                                <EditRowStyle BackColor="PaleGoldenrod" />
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:BoundField DataField="_id" HeaderText="ID" />
                                    <asp:BoundField HeaderText="名稱" ReadOnly="True" DataField="_name" 
                                        SortExpression="_name">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="_desc" HeaderText="說明" ReadOnly="True" 
                                        SortExpression="_desc">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:CommandField ButtonType="Button" EditText="修改" 
                                        CausesValidation="False" InsertVisible="False" ShowCancelButton="False" 
                                        SelectText="修改" ShowSelectButton="True" >
                                    <ItemStyle Width="50px" />
                                    </asp:CommandField>
                                    <asp:CommandField ButtonType="Button" ShowDeleteButton="True">
                                    <ItemStyle Width="50px" />
                                    </asp:CommandField>
                                </Columns>
                                <PagerTemplate>
                                    <asp:Label ID="lbAllCount" runat="server" Text="Label"></asp:Label>
                                    <asp:Button ID="First" runat="server" onclick="First_Click" Text="第一頁" CommandArgument="First" />
                                    <asp:Button ID="Previous" runat="server"  Text="前一頁" onclick="Previous_Click" CommandArgument="Previous" />
                                    <asp:Button ID="Next" runat="server"  Text="下一頁" onclick="Next_Click" CommandArgument="Next" />
                                    <asp:Button ID="Last" runat="server"  Text="最後頁" onclick="Last_Click" CommandArgument="Last" />
                                    <asp:DropDownList ID="dd1PageJump" runat="server" onselectedindexchanged="dd1PageJump_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>
                                    <asp:Label ID="lbAllPage" runat="server" Text="Label"></asp:Label>
                                </PagerTemplate>
                            </asp:GridView>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btReturn" runat="server" Text="回控制器管理" Font-Size="Medium" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" onclick="btReturn_Click" />
                            <asp:Button ID="btAddDevice" runat="server" Font-Size="Medium" 
                                Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" onclick="btAddDevice_Click" 
                                Text="新增" Visible="False" />
                        </td>
                    </tr>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <tr>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" Visible="false">
                        <ContentTemplate>
                        <tr>
                        <td align="center">
                            <asp:Panel ID="Panel3" runat="server" GroupingText="修改設備" BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" style="width: 952px">
                                <table style="margin: 0px 0px 0px 5px; border:2px double gray">
                                    <tr>
                                        <td class="GrayTxtHeader">名&nbsp;&nbsp;&nbsp;&nbsp; 稱 : </td>
                                        <td align="left"><asp:TextBox ID="DeviceName" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">組織群組: </td>
                                        <td align="left">
                                            <asp:Label ID="lbBuil" runat="server" ForeColor="Black" Text="大樓"></asp:Label>
                                            <asp:DropDownList ID="ddBuil" runat="server" CssClass="normal" 
                                                AutoPostBack="True" onselectedindexchanged="ddBuil_SelectedIndexChanged"></asp:DropDownList>
                                            <asp:Label ID="lbFlo" runat="server" ForeColor="Black" Text="樓層"></asp:Label>
                                            <asp:DropDownList ID="ddfloor" runat="server" CssClass="normal" 
                                                AutoPostBack="True" onselectedindexchanged="ddfloor_SelectedIndexChanged"></asp:DropDownList>
                                            <asp:Label ID="lbBlo" runat="server" ForeColor="Black" Text="寢室" ></asp:Label>
                                            <asp:DropDownList ID="ddBlock" runat="server" CssClass="normal" 
                                                AutoPostBack="True"></asp:DropDownList>                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">說&nbsp;&nbsp;&nbsp;&nbsp; 明 : </td>
                                        <td align="left"><asp:TextBox ID="DeviceDesc" runat="server" TextMode="MultiLine"></asp:TextBox></td>
                                    </tr> 
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="YesEdit" runat="server" Text="確定" onclick="YesEdit_Click" />
                                            <asp:Button ID="NoEdit" runat="server" Text="取消" onclick="NoEdit_Click" />
                                        </td>
                                    </tr>                             
                                </table>
                            </asp:Panel>
                        </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel3" runat="server" Visible="false">
                        <ContentTemplate>
                        <tr>
                        <td align="center">
                            <asp:Panel ID="Panel4" runat="server" GroupingText="新增設備" BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" style="width: 952px">
                                <table style="margin: 0px 0px 0px 5px; border:2px double gray">
                                    <tr>
                                        <td class="GrayTxtHeader">名&nbsp;&nbsp;&nbsp;&nbsp; 稱 : </td>
                                        <td align="left"><asp:TextBox ID="tbDevName" runat="server"></asp:TextBox></td>
                                    </tr> 
                                    <tr>
                                        <td class="GrayTxtHeader">組織群組: </td>
                                        <td align="left">
                                            <asp:Label ID="Building" runat="server" ForeColor="Black" Text="大樓"></asp:Label>
                                            <asp:DropDownList ID="ddlBuilding" runat="server" CssClass="normal" 
                                                AutoPostBack="True" onselectedindexchanged="ddlBuilding_SelectedIndexChanged"></asp:DropDownList>
                                            <asp:Label ID="Floor" runat="server" ForeColor="Black" Text="樓層"></asp:Label>
                                            <asp:DropDownList ID="ddlFloor" runat="server" CssClass="normal" 
                                                AutoPostBack="True" onselectedindexchanged="ddlFloor_SelectedIndexChanged"></asp:DropDownList>
                                            <asp:Label ID="Block" runat="server" ForeColor="Black" Text="寢室" ></asp:Label>
                                            <asp:DropDownList ID="ddlBlock" runat="server" CssClass="normal" AutoPostBack="True"></asp:DropDownList>                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">說&nbsp;&nbsp;&nbsp;&nbsp; 明 : </td>
                                        <td align="left"><asp:TextBox ID="tbDes" runat="server" TextMode="MultiLine"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="YesAdd" runat="server" Text="確定" onclick="YesAdd_Click" />
                                            <asp:Button ID="NoAdd" runat="server" Text="取消" onclick="NoAdd_Click" />
                                        </td>
                                    </tr>                             
                                </table>
                            </asp:Panel>
                        </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </td>
        </tr>
    </table>
    </center>
    </form>
</body>
</html>
